cleanup & bug fixed + events refactored