Feature/move logic from render