Refactor compose