Some more code refectoring.