code refactoring!