Implement clear warehouse
refactor