Code cleanup. Remove a lot of extension checks for unused variables