working in progress refactor and redising