Refactor to fix it all