review code, minor renamings and modifications