Added HTTP Basic Authorization + small refactorization