refactor: remove _invalidexpression blocks

Closes #298