refact blog application