Refactored and wrote some unit tests for the main firing action