Refactored file with JSBeautified