better decompisition of code