cleaned form logic