Migrate to kotlin