Separate modality framework from its usage in layers core.