refactored more and stuff