improv: clean code from basic auth logic