WIP: first implementation of resources handling