trim unused function