Removed unused function and combined functions into util.py