refactor frominputappend and prepend. refactored also components page