back to 2.7 and some refactoring