delete unused code and reorg of the classes