Model improvements & added unit tests