slightly improve code