refactor & global