refactored the logintask as an external class