Changed structure to be more modular