first implementation to solve circular reference problem