apps: some spaghetti code