started to totally refactor