refactored stuff 2