Refactor more process and tests