resource manager is now instance of document
moved text parsing method to dedicated file