refactored a couple things