grouped conditions, sorted imports
updated imports