simpler to read, adding tests