renamed a few things, refactored a few things