Refactors to add auto generation of select boxes