Update tests
Do some refactoring in renderer