DRY'ed up grammar and added number notation support