Make js object orientated