making a bit more functional