Function specification updated and added
Some UI rearrangements
Code reorganized in UI module