code cleanup for models