Messed up refactor