Encapsulate Morse logic into Class