added do_action some refactoring