script type
mock data
refactor to work around scope problems