Implement apply for local env.