Adjusting modal sizing and cleaning up code