add helper function to find out if its a mandatory field
add helper method to add attributes for non mandatory fields
use the add non mandatory attributes method