optimized code for showing todoapp