add some more elegeant solution