Apply suggestions from code review
Apply suggestions from code review

Co-authored-by: P. L. Lim <01b0ff1ff6bf52826e8c867754553ed4806180a6@users.noreply.github.com>
aleksandr-bakanov/astropy,StuartLittlefair/astropy,mhvk/astropy,saimn/astropy,larrybradley/astropy,pllim/astropy,larrybradley/astropy,pllim/astropy,lpsinger/astropy,saimn/astropy,larrybradley/astropy,lpsinger/astropy,dhomeier/astropy,StuartLittlefair/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,pllim/astropy,dhomeier/astropy,astropy/astropy,astropy/astropy,dhomeier/astropy,mhvk/astropy,saimn/astropy,pllim/astropy,saimn/astropy,astropy/astropy,larrybradley/astropy,mhvk/astropy,lpsinger/astropy,dhomeier/astropy,aleksandr-bakanov/astropy,dhomeier/astropy,StuartLittlefair/astropy,lpsinger/astropy,pllim/astropy,mhvk/astropy,larrybradley/astropy,aleksandr-bakanov/astropy,StuartLittlefair/astropy,lpsinger/astropy,saimn/astropy,astropy/astropy,astropy/astropy,mhvk/astropy