Write to use a more simple way of assign resources and perhaps less hard to use