Adding function form, globals for lint, and using function for appname