create Class template and add login function