Refactor and stuff