Reversed it to a 'more' functional version