restructure for easy composing