ENH: remove redundancy, increase efficiency