Changed ALPHABET to an object and refactored associated methods.