More tests, simpler code