Refactoring stuff

More refactor