Moved trace function to util library