Cleaned up code, preparing for the first real improvment to the sdk!!