little perf refactor