Move js to separate file, add contextual prompt