More flexible constructor