Refactored to provide meaningful API