refactor config file and add auth