refactoging, review and redesign