Implemented revoke and general code cleanup