Refactor functions 'startShots' and 'stopShots' functions.