Code cleanup and modularity.