[IMP] Improving the code