Refactor everthing