Moving code around and optimizing.