Some refactor for clarity.