Refactored to define clean interface