add some more elegant solution