built device services and worked through device flow. Code cleanup and commenting