refactor ability macro