Improve code after compare review