converted all user layer objects to use context and resolve_ref