Starting refactor of code - stripping out unnecessary code.