Cleaned up demo application code