Added Loading spec into form

code clean up and adding comments.
Added loadSpecIntoForm. including all helper functions.