More refactor and changes