more simplification, and correct a bug i introduced in the last commit