Some more cleaning up and improving