HCOLL-167 cleaned up the code