ugly decission logic, sorry