Code cleanup - Build form with functions