Clean up codes
Add authentication