cleanup

Making the code less embarrassing to look at.