add benchmark, minor refactor