Reduce code duplication
Make generation of drop downs more efficient
Cleanup