Refactored to new design