Some refactor, better design