Major revision to support auth