renamed cast -> escape, added query method