Refactor parse_valid_user method and remove unused variables