complete refactoring of practically all variable names and callback routines, fixes #1