optimize the compose