section 1 move logic to controllers