Code refactoring, added refering