package refactoring + add conditional utility