refactored due to split off server component