improved test functionality