Added encode/decode and the singleton class Application