extract common constructor code and add some docstrings