Add users action, some refactoring