Added authentication, style, refactor