split constructor out