refine
rewrite for simplisity