Refactored the signature of some functions, got rid of useless utility funciton