This component can probably supplant the following 500 lines of code...