Moved logic out of Marketplace to framework and theme