Code refactor in report module