tiding up, abrastracting and added new modules