improve layout, add validation when editing and code cleanup