Some refactor done