Improve revision JS to best practices