Many refactoring. At least, it is fully compiling