Code reorganization
increase perf