Code clean up

Code refactoring for integration into Hysope II platform is done. Now we are going to remove all obsolete code to got it easy to understand.