more functional approach added