Improve method to add functions at client-side