yeah extracted same functionality