Code clean up and formalise version 1.1.0