Moved dimensions calculation to dummy context object.