improve code again