added class deletion and refactored some of the logged in user detection
code