switching schema for mat to rb