integrate @leathrum's extensions