Tidy up and semantics input foundations