Complete code refactor.