move functionality into components