First refactor with new API and composer support.