refactored some code