refactor audit lib