Move validation/clean code around