strongly type attributes

@cos please review