diff --git a/model/sync-app-socket-c.cc b/model/sync-app-socket-c.cc
index 0bd9f0f..0fc03e1 100644
--- a/model/sync-app-socket-c.cc
+++ b/model/sync-app-socket-c.cc
@@ -25,43 +25,43 @@
 using namespace Sync;
 
 class CallbackHolder{
-	public:
-	void (*m_callback)(const char *, const char *);
-	void callbackWrapper(string name, string data) {
-		m_callback(name.c_str(), data.c_str());
-	}
+public:
+  void (*m_callback)(const char *, const char *);
+  void callbackWrapper(string name, string data) {
+    m_callback(name.c_str(), data.c_str());
+  }
 };
 
 SyncAppSocketStruct *
 create_sync_app_socket(const char *prefix, void (*callback)(const char *, const char *)) 
-	{
-		CallbackHolder holder;
-		holder.m_callback = callback;
-		boost::function<void (string, string)> cb = bind(&CallbackHolder::callbackWrapper, &holder, _1, _2);
-		SyncAppSocket *sock = new SyncAppSocket(prefix, cb);
-		return (SyncAppSocketStruct *) sock;
-	}
+{
+  CallbackHolder holder;
+  holder.m_callback = callback;
+  boost::function<void (string, string)> cb = bind(&CallbackHolder::callbackWrapper, &holder, _1, _2);
+  SyncAppSocket *sock = new SyncAppSocket(prefix, cb);
+  return (SyncAppSocketStruct *) sock;
+}
 
 
 void
 delete_sync_app_socket(SyncAppSocketStruct **sock) {
-		SyncAppSocket *temp = *((SyncAppSocket **)sock);
-		delete temp;
-		temp = NULL;
-	}
+  SyncAppSocket *temp = *((SyncAppSocket **)sock);
+  delete temp;
+  temp = NULL;
+}
 
 // assume char *buf ends with '\0', or otherwise it's going to crash;
 // should fix this "feature" 
 bool
 sync_app_socket_publish(SyncAppSocketStruct *sock, const char *prefix, uint32_t session, const char *buf, int freshness) 
-	{
-		SyncAppSocket *temp = (SyncAppSocket *)sock;
-		return temp->publish(prefix, session, buf, freshness);
-	}
+{
+  SyncAppSocket *temp = (SyncAppSocket *)sock;
+  return temp->publish(prefix, session, buf, freshness);
+}
 
 void
 sync_app_socket_remove(SyncAppSocketStruct *sock, const char *prefix) 
-	{
-		SyncAppSocket *temp = (SyncAppSocket *)sock;
-		temp->remove(prefix);
-	}
+{
+  SyncAppSocket *temp = (SyncAppSocket *)sock;
+  temp->remove(prefix);
+}
