add more elegant solution