Refactor data-transformer