possible to minimize, added tests, param, refact