Moved LoginUser code to Logic class