outlining of a possible application archetcture, crappy, incomplete code