Add authorization form; refactor the code