scoping remaining javascript methods