Move code from swirl main repo