basic authentication added
simple refactor