Clean up code and add new renderSelect() method