more improvements and bump to 1.3.1