refactored shit