Code refactor for strict mode + code cleanup