Refactor preauth chapter