Refactor IV

More refactoring