Cleaned up base.js