one order + refactoring + fix bugs