refactored minor shit