prepare for drastic code moving
successfully separated out js