Using a more elegant solution