BS-1849 : Refactor code