Added conditions, moved selectors to own file