code simplification, refactoring