refactored businesslogic