clean js to be called on DOMContentLoaded