this is totally unreadable, I think we should find a better way to do this... also, this file imports several modules that are never used