Added strict mode and refactored