start restructure and merge of code