restructuring for a proper app