Handling credentials better