A more functional approach.