Improve Performance and Clean code