better code and more elegancy