restructured content_script to be more logical