simplify implementation (also fixes test)