Qt code refactor [Stage 1]

Revert some previous temporary changes that aren't needed after refactor.