Refactored some