minor refactoring + HOptions