Fix issue #2 refactor encode.go

- Clean up strings with constants
- refactor the switch to have a default