JS refactor to remove need for .js format