Refactoring, calc speedup by 30%