refactored
refactored even better