I really need to refactor :)