Clean up code and added functionality for dropdown change data.