Refactor some