Refactor push code