refactor context builder