Refactors a number of classes to clean them up

It also extracts functionality into either new classes or existing ones which fit better for responsibility