cleaned up angular controller