General structure changes, added validation rules, clean ups and updated example