- refactored some code