Update application structure. Modularize output write frames etc