Clean up and refactor a couple things