some refactoring, Binner moved outside