Improve code efficiency