some useful patterns