cleanups: whitespaces; checks for mandatory fields