improve code efficiency