final refactoring; speed reached: 1.65ns/op