Implemented nested templates