use derived mode instead of manually doing everything