made rendering more flexible