moved immutant to inside src, put init inside its own function