Refactor

More refactoring fixes.