refactored somethings