some refactoring and more work on the create action