Code cleanup for less disgustingness.