Change compose API to be decoupled from layers