some basic codes for app.