More functional approach used