refactoring

remove redundant partial function application
fix some typos, cleanup generate-expression function