port some of the common.model package from Java version