refactored some of the base stuff