more functional code