refactored some older stuff