Added more tests
Refactored `$render`