Moved more code to static file