Cleaned up to pass JSLint