required fields and code clean up