now using module and constructor patterns