Introduced modules and removed unused code