make this more flexible