[IMP] code refactoring