try to improve code