Move handlers and formatters out

Change-Id: I5ac57443c1f378665ad209481b2b4d14559ff858