Refactor, add groups