convenient constructor especially for testing