[CHG,IMP] Code refactoring