base form code refactoring