remove unused functions and obsolete comments; reorganize
make "nice" variable name conversion more general