Adding strict mode, charset and refactoring.