added sign up form functionality, refactor