Refactored to create common js file for departure view model