refactor this please _Originally posted by @iamitprakash in https://github.com/Real-Dev-Squad/website-backend/pull/2478#discussion_r2320224600_