migrate to relative imports and extract demo mains