remove dead code and and log user last activity