Refractoring, part 6

Almost everything working