refactored to the new style