model clear, code cleanup