refactor making barista stateless and configured without using strings