improve constructor