Refactored the Brown Aviation automation code