cleanup
more generalization

test