compose logic