Updated to support different context