Improve the code a bit.