added functional inheritance approach