refactoring + all actions + fix bug