refactored, moved things around