Refactor sensorsubmit functions into separate file