ENH: code cleanup