Improve code; replace extern variables with public functions to get/set; seperate product and location stuff in seperate files.