Refactor some more things