More tests. Simplify code.