Code much more modular now.