more elegant solution for #3