[IMP] Improve code as per suggestion