fixes #12, procedure type is a required field.
Code cleanup