Refactored;improved