Improve the code implementation.