Proc-base refactoring for speed up