Refactor many things