move whitespace and parentheses generation logic into separate files