implement layout mappers; closes #339