Merge of refactoring

This is mainly to test jenkins and CI work