Internal refactoring: renaming classes, adding comments, adding some user toasts and log messages.