Cleaned up some minor stuff and switched event handler version