a little bit more functional programming