Refactor primary