Replace app methods with plain functions