refactor things for >2.7