Changed to crockfords functional way of creating objects