fixes render-loop bug, refactors components