ENH: just minor tune ups to make code a bit more generalizable and concise