renamed realMain to appMain and moved to app.go