Tidy and clean out old code