another code refactoring