improved interface and added test