Re-factoring to move common functions into Util classes