refactored code to solve circular imports