Some backend cleanup for login