move config function into class