moved if-cases