diff --git a/gui/animation.cpp b/gui/animation.cpp
index 771e1c1..1e9a87d 100644
--- a/gui/animation.cpp
+++ b/gui/animation.cpp
@@ -43,9 +43,7 @@
 	child = node->first_node("resource");
 	if (child)
 	{
-		attr = child->first_attribute("name");
-		if (attr)
-			mAnimation = (AnimationResource*) PageManager::FindResource(attr->value());
+		mAnimation = LoadAttrAnimation(child, "name");
 	}
 
 	// Load the placement
@@ -77,8 +75,8 @@
 	// Fetch the render sizes
 	if (mAnimation && mAnimation->GetResource())
 	{
-		mRenderW = gr_get_width(mAnimation->GetResource());
-		mRenderH = gr_get_height(mAnimation->GetResource());
+		mRenderW = mAnimation->GetWidth();
+		mRenderH = mAnimation->GetHeight();
 
 		// Adjust for placement
 		if (mPlacement != TOP_LEFT && mPlacement != BOTTOM_LEFT)
diff --git a/gui/button.cpp b/gui/button.cpp
index 943d719..6ea0bee 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -98,9 +98,7 @@
 	child = node->first_node("icon");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mButtonIcon = PageManager::FindResource(attr->value());
+		mButtonIcon = LoadAttrImage(child, "resource");
 	}
 
 	memset(&mHighlightColor, 0, sizeof(COLOR));
@@ -122,14 +120,13 @@
 		LoadPlacement(node->first_node("placement"), &x, &y, &w, &h, &TextPlacement);
 	}
 	SetRenderPos(x, y, w, h);
-	return;
 }
 
 GUIButton::~GUIButton()
 {
-	if (mButtonImg)	 	delete mButtonImg;
-	if (mButtonLabel)   delete mButtonLabel;
-	if (mAction)		delete mAction;
+	delete mButtonImg;
+	delete mButtonLabel;
+	delete mAction;
 }
 
 int GUIButton::Render(void)
@@ -221,12 +218,8 @@
 		mRenderH = h;
 	}
 
-	mIconW = 0;	 mIconH = 0;
-	if (mButtonIcon && mButtonIcon->GetResource())
-	{
-		mIconW = gr_get_width(mButtonIcon->GetResource());
-		mIconH = gr_get_height(mButtonIcon->GetResource());
-	}
+	mIconW = mButtonIcon->GetWidth();
+	mIconH = mButtonIcon->GetHeight();
 
 	mTextH = 0;
 	mTextW = 0;
diff --git a/gui/checkbox.cpp b/gui/checkbox.cpp
index fe5f557..f4900ba 100644
--- a/gui/checkbox.cpp
+++ b/gui/checkbox.cpp
@@ -48,12 +48,8 @@
 	child = node->first_node("image");
 	if (child)
 	{
-		attr = child->first_attribute("checked");
-		if (attr)
-			mChecked = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("unchecked");
-		if (attr)
-			mUnchecked = PageManager::FindResource(attr->value());
+		mChecked = LoadAttrImage(child, "checked");
+		mUnchecked = LoadAttrImage(child, "unchecked");
 	}
 
 	// Get the variable data
@@ -68,22 +64,17 @@
 			DataManager::SetValue(mVarName, attr->value());
 	}
 
-	mCheckW = 0;	mCheckH = 0;
-	if (mChecked && mChecked->GetResource())
+	mCheckW = mChecked->GetWidth();
+	mCheckH = mChecked->GetHeight();
+	if (mCheckW == 0)
 	{
-		mCheckW = gr_get_width(mChecked->GetResource());
-		mCheckH = gr_get_height(mChecked->GetResource());
-	}
-	else if (mUnchecked && mUnchecked->GetResource())
-	{
-		mCheckW = gr_get_width(mUnchecked->GetResource());
-		mCheckH = gr_get_height(mUnchecked->GetResource());
+		mCheckW = mUnchecked->GetWidth();
+		mCheckH = mUnchecked->GetHeight();
 	}
 
 	int x, y, w, h;
 	mLabel->GetRenderPos(x, y, w, h);
 	SetRenderPos(x, y, 0, 0);
-	return;
 }
 
 GUICheckbox::~GUICheckbox()
diff --git a/gui/console.cpp b/gui/console.cpp
index 9c780c0..bb70400 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -129,32 +129,15 @@
 		child = node->first_node("font");
 		if (child)
 		{
-			attr = child->first_attribute("resource");
-			if (attr)
-				mFont = PageManager::FindResource(attr->value());
+			mFont = LoadAttrFont(child, "resource");
 		}
 
 		child = node->first_node("color");
 		if (child)
 		{
-			attr = child->first_attribute("foreground");
-			if (attr)
-			{
-				std::string color = attr->value();
-				ConvertStrToColor(color, &mForegroundColor);
-			}
-			attr = child->first_attribute("background");
-			if (attr)
-			{
-				std::string color = attr->value();
-				ConvertStrToColor(color, &mBackgroundColor);
-			}
-			attr = child->first_attribute("scroll");
-			if (attr)
-			{
-				std::string color = attr->value();
-				ConvertStrToColor(color, &mScrollColor);
-			}
+			mForegroundColor = LoadAttrColor(child, "foreground", mForegroundColor);
+			mBackgroundColor = LoadAttrColor(child, "background", mBackgroundColor);
+			mScrollColor = LoadAttrColor(child, "scroll", mScrollColor);
 		}
 
 		// Load the placement
@@ -166,21 +149,19 @@
 			mSlideout = 1;
 			LoadPlacement(child, &mSlideoutX, &mSlideoutY);
 
-			attr = child->first_attribute("resource");
-			if (attr)   mSlideoutImage = PageManager::FindResource(attr->value());
+			mSlideoutImage = LoadAttrImage(child, "resource");
 
 			if (mSlideoutImage && mSlideoutImage->GetResource())
 			{
-				mSlideoutW = gr_get_width(mSlideoutImage->GetResource());
-				mSlideoutH = gr_get_height(mSlideoutImage->GetResource());
+				mSlideoutW = mSlideoutImage->GetWidth();
+				mSlideoutH = mSlideoutImage->GetHeight();
 			}
 		}
 	}
 
-	mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
+	mFontHeight = mFont->GetHeight();
 	SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
 	SetRenderPos(mConsoleX, mConsoleY);
-	return;
 }
 
 int GUIConsole::RenderSlideout(void)
diff --git a/gui/fileselector.cpp b/gui/fileselector.cpp
index 319b11b..5c287c3 100644
--- a/gui/fileselector.cpp
+++ b/gui/fileselector.cpp
@@ -40,7 +40,6 @@
 	xml_attribute<>* attr;
 	xml_node<>* child;
 
-	int mIconWidth = 0, mIconHeight = 0, mFolderIconHeight = 0, mFileIconHeight = 0, mFolderIconWidth = 0, mFileIconWidth = 0;
 	mFolderIcon = mFileIcon = NULL;
 	mShowFolders = mShowFiles = mShowNavFolders = 1;
 	mUpdate = 0;
@@ -109,29 +108,12 @@
 	// Get folder and file icons if present
 	child = node->first_node("icon");
 	if (child) {
-		attr = child->first_attribute("folder");
-		if (attr)
-			mFolderIcon = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("file");
-		if (attr)
-			mFileIcon = PageManager::FindResource(attr->value());
+		mFolderIcon = LoadAttrImage(child, "folder");
+		mFileIcon = LoadAttrImage(child, "file");
 	}
-	if (mFolderIcon && mFolderIcon->GetResource()) {
-		mFolderIconWidth = gr_get_width(mFolderIcon->GetResource());
-		mFolderIconHeight = gr_get_height(mFolderIcon->GetResource());
-		if (mFolderIconHeight > mIconHeight)
-			mIconHeight = mFolderIconHeight;
-		mIconWidth = mFolderIconWidth;
-	}
-	if (mFileIcon && mFileIcon->GetResource()) {
-		mFileIconWidth = gr_get_width(mFileIcon->GetResource());
-		mFileIconHeight = gr_get_height(mFileIcon->GetResource());
-		if (mFileIconHeight > mIconHeight)
-			mIconHeight = mFileIconHeight;
-		if (mFileIconWidth > mIconWidth)
-			mIconWidth = mFileIconWidth;
-	}
-	SetMaxIconSize(mIconWidth, mIconHeight);
+	int iconWidth = std::max(mFolderIcon->GetWidth(), mFileIcon->GetWidth());
+	int iconHeight = std::max(mFolderIcon->GetHeight(), mFileIcon->GetHeight());
+	SetMaxIconSize(iconWidth, iconHeight);
 
 	// Fetch the file/folder list
 	std::string value;
@@ -318,7 +300,7 @@
 	return folderSize + fileSize;
 }
 
-int GUIFileSelector::GetListItem(size_t item_index, Resource*& icon, std::string &text)
+int GUIFileSelector::GetListItem(size_t item_index, ImageResource*& icon, std::string &text)
 {
 	size_t folderSize = mShowFolders ? mFolderList.size() : 0;
 	size_t fileSize = mShowFiles ? mFileList.size() : 0;
diff --git a/gui/image.cpp b/gui/image.cpp
index 2cf3b68..60b1cb9 100644
--- a/gui/image.cpp
+++ b/gui/image.cpp
@@ -40,12 +40,8 @@
 	child = node->first_node("image");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mImage = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("highlightresource");
-		if (attr)
-			mHighlightImage = PageManager::FindResource(attr->value());
+		mImage = LoadAttrImage(child, "resource");
+		mHighlightImage = LoadAttrImage(child, "highlightresource");
 	}
 
 	// Load the placement
@@ -53,8 +49,8 @@
 
 	if (mImage && mImage->GetResource())
 	{
-		mRenderW = gr_get_width(mImage->GetResource());
-		mRenderH = gr_get_height(mImage->GetResource());
+		mRenderW = mImage->GetWidth();
+		mRenderH = mImage->GetHeight();
 
 		// Adjust for placement
 		if (mPlacement != TOP_LEFT && mPlacement != BOTTOM_LEFT)
@@ -73,8 +69,6 @@
 		}
 		SetPlacement(TOP_LEFT);
 	}
-
-	return;
 }
 
 int GUIImage::Render(void)
diff --git a/gui/input.cpp b/gui/input.cpp
index e893335..299034a 100644
--- a/gui/input.cpp
+++ b/gui/input.cpp
@@ -88,35 +88,21 @@
 	child = node->first_node("background");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mBackground = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("color");
-		if (attr)
-		{
-			std::string color = attr->value();
-			ConvertStrToColor(color, &mBackgroundColor);
-		}
+		mBackground = LoadAttrImage(child, "resource");
+		mBackgroundColor = LoadAttrColor(child, "color", mBackgroundColor);
 	}
 	if (mBackground && mBackground->GetResource())
 	{
-		mBackgroundW = gr_get_width(mBackground->GetResource());
-		mBackgroundH = gr_get_height(mBackground->GetResource());
+		mBackgroundW = mBackground->GetWidth();
+		mBackgroundH = mBackground->GetHeight();
 	}
 
 	// Load the cursor color
 	child = node->first_node("cursor");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mCursor = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("color");
-		if (attr)
-		{
-			std::string color = attr->value();
-			ConvertStrToColor(color, &mCursorColor);
-		}
+		mCursor = LoadAttrImage(child, "resource");
+		mCursorColor = LoadAttrColor(child, "color", mCursorColor);
 		attr = child->first_attribute("hasfocus");
 		if (attr)
 		{
@@ -132,15 +118,12 @@
 	}
 	DrawCursor = HasInputFocus;
 
-	// Load the font, and possibly override the color
+	// Load the font
 	child = node->first_node("font");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr) {
-			mFont = PageManager::FindResource(attr->value());
-			mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
-		}
+		mFont = LoadAttrFont(child, "resource");
+		mFontHeight = mFont->GetHeight();
 	}
 
 	child = node->first_node("text");
@@ -213,8 +196,8 @@
 
 GUIInput::~GUIInput()
 {
-	if (mInputText)	 	delete mInputText;
-	if (mAction)		delete mAction;
+	delete mInputText;
+	delete mAction;
 }
 
 int GUIInput::HandleTextLocation(int x)
diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp
index db968ae..5528be9 100644
--- a/gui/keyboard.cpp
+++ b/gui/keyboard.cpp
@@ -102,7 +102,7 @@
 		strcpy(resource, "resource1");
 		attr = child->first_attribute(resource);
 		while (attr && layoutindex < (MAX_KEYBOARD_LAYOUTS + 1)) {
-			keyboardImg[layoutindex - 1] = PageManager::FindResource(attr->value());
+			keyboardImg[layoutindex - 1] = LoadAttrImage(child, resource);
 
 			layoutindex++;
 			resource[8] = (char)(layoutindex + 48);
@@ -113,8 +113,8 @@
 	// Check the first image to get height and width
 	if (keyboardImg[0] && keyboardImg[0]->GetResource())
 	{
-		KeyboardWidth = gr_get_width(keyboardImg[0]->GetResource());
-		KeyboardHeight = gr_get_height(keyboardImg[0]->GetResource());
+		KeyboardWidth = keyboardImg[0]->GetWidth();
+		KeyboardHeight = keyboardImg[0]->GetHeight();
 	}
 
 	// Load all of the layout maps
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index 37ba958..7c7afa9 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -34,36 +34,17 @@
 	xml_attribute<>* attr;
 	xml_node<>* child;
 	mIconSelected = mIconUnselected = NULL;
-	int mSelectedIconWidth = 0, mSelectedIconHeight = 0, mUnselectedIconWidth = 0, mUnselectedIconHeight = 0, mIconWidth = 0, mIconHeight = 0;
 	mUpdate = 0;
 
 	// Get the icons, if any
 	child = node->first_node("icon");
 	if (child) {
-		attr = child->first_attribute("selected");
-		if (attr)
-			mIconSelected = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("unselected");
-		if (attr)
-			mIconUnselected = PageManager::FindResource(attr->value());
+		mIconSelected = LoadAttrImage(child, "selected");
+		mIconUnselected = LoadAttrImage(child, "unselected");
 	}
-	if (mIconSelected && mIconSelected->GetResource()) {
-		mSelectedIconWidth = gr_get_width(mIconSelected->GetResource());
-		mSelectedIconHeight = gr_get_height(mIconSelected->GetResource());
-		if (mSelectedIconHeight > mIconHeight)
-			mIconHeight = mSelectedIconHeight;
-		mIconWidth = mSelectedIconWidth;
-	}
-
-	if (mIconUnselected && mIconUnselected->GetResource()) {
-		mUnselectedIconWidth = gr_get_width(mIconUnselected->GetResource());
-		mUnselectedIconHeight = gr_get_height(mIconUnselected->GetResource());
-		if (mUnselectedIconHeight > mIconHeight)
-			mIconHeight = mUnselectedIconHeight;
-		if (mUnselectedIconWidth > mIconWidth)
-			mIconWidth = mUnselectedIconWidth;
-	}
-	SetMaxIconSize(mIconWidth, mIconHeight);
+	int iconWidth = std::max(mIconSelected->GetWidth(), mIconUnselected->GetWidth());
+	int iconHeight = std::max(mIconSelected->GetHeight(), mIconUnselected->GetHeight());
+	SetMaxIconSize(iconWidth, iconHeight);
 
 	// Handle the result variable
 	child = node->first_node("data");
@@ -160,7 +141,7 @@
 	return mList.size();
 }
 
-int GUIListBox::GetListItem(size_t item_index, Resource*& icon, std::string &text)
+int GUIListBox::GetListItem(size_t item_index, ImageResource*& icon, std::string &text)
 {
 	text = mList.at(item_index).displayName;
 	if (mList.at(item_index).selected)
diff --git a/gui/mousecursor.cpp b/gui/mousecursor.cpp
index 1c22356..6255886 100644
--- a/gui/mousecursor.cpp
+++ b/gui/mousecursor.cpp
@@ -58,19 +58,12 @@
 	child = node->first_node("background");
 	if(child)
 	{
-		attr = child->first_attribute("color");
-		if(attr)
-			ConvertStrToColor(attr->value(), &m_color);
-
-		attr = child->first_attribute("resource");
-		if(attr)
+		m_color = LoadAttrColor(child, "color", m_color);
+		m_image = LoadAttrImage(child, "resource");
+		if(m_image)
 		{
-			m_image = PageManager::FindResource(attr->value());
-			if(m_image)
-			{
-				mRenderW = gr_get_width(m_image->GetResource());
-				mRenderH = gr_get_height(m_image->GetResource());
-			}
+			mRenderW = m_image->GetWidth();
+			mRenderH = m_image->GetHeight();
 		}
 	}
 
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 5eae919..537de20 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -211,13 +211,12 @@
 	std::string mLastValue;
 	COLOR mColor;
 	COLOR mHighlightColor;
-	Resource* mFont;
+	FontResource* mFont;
 	int mIsStatic;
 	int mVarChanged;
 	int mFontHeight;
 	unsigned maxWidth;
 	unsigned charSkip;
-	bool hasHighlightColor;
 
 protected:
 	std::string parseText(void);
@@ -242,8 +241,8 @@
 	bool isHighlighted;
 
 protected:
-	Resource* mImage;
-	Resource* mHighlightImage;
+	ImageResource* mImage;
+	ImageResource* mHighlightImage;
 };
 
 // GUIFill - Used for fill colors
@@ -402,8 +401,8 @@
 		request_show
 	};
 
-	Resource* mFont;
-	Resource* mSlideoutImage;
+	FontResource* mFont;
+	ImageResource* mSlideoutImage;
 	COLOR mForegroundColor;
 	COLOR mBackgroundColor;
 	COLOR mScrollColor;
@@ -453,7 +452,7 @@
 
 protected:
 	GUIImage* mButtonImg;
-	Resource* mButtonIcon;
+	ImageResource* mButtonIcon;
 	GUIText* mButtonLabel;
 	GUIAction* mAction;
 	int mTextX, mTextY, mTextW, mTextH;
@@ -491,8 +490,8 @@
 	virtual int NotifyTouch(TOUCH_STATE state, int x, int y);
 
 protected:
-	Resource* mChecked;
-	Resource* mUnchecked;
+	ImageResource* mChecked;
+	ImageResource* mUnchecked;
 	GUIText* mLabel;
 	int mTextX, mTextY;
 	int mCheckX, mCheckY, mCheckW, mCheckH;
@@ -501,12 +500,6 @@
 	std::string mVarName;
 };
 
-struct ScrollListData {
-	Resource* displayResource;
-	std::string displayName;
-	int list_index;
-};
-
 class GUIScrollList : public GUIObject, public RenderObject, public ActionObject
 {
 public:
@@ -541,7 +534,7 @@
 	// get number of items
 	virtual size_t GetItemCount() { return 0; }
 	// get data for one item
-	virtual int GetListItem(size_t item_index, Resource*& icon, std::string &text)
+	virtual int GetListItem(size_t item_index, ImageResource*& icon, std::string &text)
 		{ icon = NULL; text = ""; return -1; }
 	// an item was selected
 	virtual void NotifySelect(size_t item_selected) {}
@@ -568,7 +561,7 @@
 protected:
 	// Background
 	COLOR mBackgroundColor;
-	Resource* mBackground; // background image, if any, automatically centered
+	ImageResource* mBackground; // background image, if any, automatically centered
 	int mBackgroundW, mBackgroundH; // background width and height if using an image for the background
 
 	// Header
@@ -578,13 +571,13 @@
 	std::string mLastHeaderValue; // Header text after parsing variables
 	int mHeaderIsStatic; // indicates if the header is static (no need to check for changes in NotifyVarChange)
 	int mHeaderH; // actual header height including font, icon, padding, and separator heights
-	Resource* mHeaderIcon;
+	ImageResource* mHeaderIcon;
 	int mHeaderIconHeight, mHeaderIconWidth; // width and height of the header icon if present
 	int mHeaderSeparatorH; // Height of the separator between header and list items
 	COLOR mHeaderSeparatorColor; // color of the header separator
 
 	// Per-item layout
-	Resource* mFont;
+	FontResource* mFont;
 	COLOR mFontColor;
 	bool hasHighlightColor; // indicates if a hightlight color was set
 	bool hasFontHighlightColor; // indicates if the font hightlight color is set
@@ -633,7 +626,7 @@
 	virtual void SetPageFocus(int inFocus);
 
 	virtual size_t GetItemCount();
-	virtual int GetListItem(size_t item_index, Resource*& icon, std::string &text);
+	virtual int GetListItem(size_t item_index, ImageResource*& icon, std::string &text);
 	virtual void NotifySelect(size_t item_selected);
 
 protected:
@@ -664,8 +657,8 @@
 	int mShowFolders, mShowFiles; // indicates if the list should show folders and/or files
 	int mShowNavFolders; // indicates if the list should include the "up a level" item and allow you to traverse folders (nav folders are disabled for the restore list, for instance)
 	static int mSortOrder; // must be static because it is used by the static function fileSort
-	Resource* mFolderIcon;
-	Resource* mFileIcon;
+	ImageResource* mFolderIcon;
+	ImageResource* mFileIcon;
 	bool updateFileList;
 };
 
@@ -687,7 +680,7 @@
 	virtual void SetPageFocus(int inFocus);
 
 	virtual size_t GetItemCount();
-	virtual int GetListItem(size_t item_index, Resource*& icon, std::string &text);
+	virtual int GetListItem(size_t item_index, ImageResource*& icon, std::string &text);
 	virtual void NotifySelect(size_t item_selected);
 
 protected:
@@ -701,8 +694,8 @@
 	std::vector<ListData> mList;
 	std::string mVariable;
 	std::string currentValue;
-	Resource* mIconSelected;
-	Resource* mIconUnselected;
+	ImageResource* mIconSelected;
+	ImageResource* mIconUnselected;
 };
 
 class GUIPartitionList : public GUIScrollList
@@ -723,7 +716,7 @@
 	virtual void SetPageFocus(int inFocus);
 
 	virtual size_t GetItemCount();
-	virtual int GetListItem(size_t item_index, Resource*& icon, std::string &text);
+	virtual int GetListItem(size_t item_index, ImageResource*& icon, std::string &text);
 	virtual void NotifySelect(size_t item_selected);
 
 protected:
@@ -737,8 +730,8 @@
 	std::string selectedList;
 	std::string currentValue;
 	std::string mLastValue;
-	Resource* mIconSelected;
-	Resource* mIconUnselected;
+	ImageResource* mIconSelected;
+	ImageResource* mIconUnselected;
 	bool updateList;
 };
 
@@ -785,8 +778,8 @@
 	virtual int NotifyVarChange(const std::string& varName, const std::string& value);
 
 protected:
-	Resource* mEmptyBar;
-	Resource* mFullBar;
+	ImageResource* mEmptyBar;
+	ImageResource* mFullBar;
 	std::string mMinValVar;
 	std::string mMaxValVar;
 	std::string mCurValVar;
@@ -820,9 +813,9 @@
 
 protected:
 	GUIAction* sAction;
-	Resource* sSlider;
-	Resource* sSliderUsed;
-	Resource* sTouch;
+	ImageResource* sSlider;
+	ImageResource* sSliderUsed;
+	ImageResource* sTouch;
 	int sTouchW, sTouchH;
 	int sCurTouchX;
 	int sUpdate;
@@ -875,7 +868,7 @@
 		int revert_layout;
 	};
 
-	Resource* keyboardImg[MAX_KEYBOARD_LAYOUTS];
+	ImageResource* keyboardImg[MAX_KEYBOARD_LAYOUTS];
 	struct keyboard_key_class keyboard_keys[MAX_KEYBOARD_LAYOUTS][MAX_KEYBOARD_ROWS][MAX_KEYBOARD_KEYS];
 	struct capslock_tracking_struct caps_tracking[MAX_KEYBOARD_LAYOUTS];
 	bool mRendered;
@@ -924,9 +917,9 @@
 protected:
 	GUIText* mInputText;
 	GUIAction* mAction;
-	Resource* mBackground;
-	Resource* mCursor;
-	Resource* mFont;
+	ImageResource* mBackground;
+	ImageResource* mCursor;
+	FontResource* mFont;
 	std::string mText;
 	std::string mLastValue;
 	std::string mVariable;
@@ -1019,7 +1012,7 @@
 	float mValuePct;
 	std::string mMaxStr;
 	std::string mMinStr;
-	Resource *mFont;
+	FontResource *mFont;
 	GUIText* mLabel;
 	int mLabelW;
 	COLOR mTextColor;
@@ -1041,9 +1034,9 @@
 	bool mChangeOnDrag;
 	int mLineW;
 	bool mDragging;
-	Resource *mBackgroundImage;
-	Resource *mHandleImage;
-	Resource *mHandleHoverImage;
+	ImageResource *mBackgroundImage;
+	ImageResource *mHandleImage;
+	ImageResource *mHandleHoverImage;
 };
 
 class MouseCursor : public RenderObject
@@ -1067,11 +1060,20 @@
 	bool m_moved;
 	float m_speedMultiplier;
 	COLOR m_color;
-	Resource *m_image;
+	ImageResource *m_image;
 	bool m_present;
 };
 
 // Helper APIs
+std::string LoadAttrString(xml_node<>* element, const char* attrname, const char* defaultvalue = "");
+int LoadAttrInt(xml_node<>* element, const char* attrname, int defaultvalue = 0);
+int LoadAttrIntScaleX(xml_node<>* element, const char* attrname, int defaultvalue = 0);
+int LoadAttrIntScaleY(xml_node<>* element, const char* attrname, int defaultvalue = 0);
+COLOR LoadAttrColor(xml_node<>* element, const char* attrname, COLOR defaultvalue = COLOR(0,0,0,0));
+FontResource* LoadAttrFont(xml_node<>* element, const char* attrname);
+ImageResource* LoadAttrImage(xml_node<>* element, const char* attrname);
+AnimationResource* LoadAttrAnimation(xml_node<>* element, const char* attrname);
+
 bool LoadPlacement(xml_node<>* node, int* x, int* y, int* w = NULL, int* h = NULL, RenderObject::Placement* placement = NULL);
 
 #endif  // _OBJECTS_HEADER
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 47e2edd..58e99e6 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -70,7 +70,7 @@
 	DataManager::GetValue(str, str);
 
 	// Look for some defaults
-	if (str == "black")			return 0;
+	if (str == "black")		return 0;
 	else if (str == "white")	{ color->red = color->green = color->blue = 255; return 0; }
 	else if (str == "red")		{ color->red = 255; return 0; }
 	else if (str == "green")	{ color->green = 255; return 0; }
@@ -103,52 +103,94 @@
 }
 
 // Helper APIs
+std::string LoadAttrString(xml_node<>* element, const char* attrname, const char* defaultvalue)
+{
+	if (!element)
+		return defaultvalue;
+
+	xml_attribute<>* attr = element->first_attribute(attrname);
+	return attr ? attr->value() : defaultvalue;
+}
+
+int LoadAttrInt(xml_node<>* element, const char* attrname, int defaultvalue)
+{
+	string value = LoadAttrString(element, attrname);
+	// resolve variables
+	DataManager::GetValue(value, value);
+	return value.empty() ? defaultvalue : atoi(value.c_str());
+}
+
+int LoadAttrIntScaleX(xml_node<>* element, const char* attrname, int defaultvalue)
+{
+	return scale_theme_x(LoadAttrInt(element, attrname, defaultvalue));
+}
+
+int LoadAttrIntScaleY(xml_node<>* element, const char* attrname, int defaultvalue)
+{
+	return scale_theme_y(LoadAttrInt(element, attrname, defaultvalue));
+}
+
+COLOR LoadAttrColor(xml_node<>* element, const char* attrname, COLOR defaultvalue)
+{
+	string value = LoadAttrString(element, attrname);
+	// resolve variables
+	DataManager::GetValue(value, value);
+	COLOR ret = defaultvalue;
+	if (ConvertStrToColor(value, &ret) == 0)
+		return ret;
+	else
+		return defaultvalue;
+}
+
+FontResource* LoadAttrFont(xml_node<>* element, const char* attrname)
+{
+	std::string name = LoadAttrString(element, attrname, "");
+	if (name.empty())
+		return NULL;
+	else
+		return (FontResource*) PageManager::FindResource(name);
+	// TODO: make resource lookup type-safe
+}
+
+ImageResource* LoadAttrImage(xml_node<>* element, const char* attrname)
+{
+	std::string name = LoadAttrString(element, attrname, "");
+	if (name.empty())
+		return NULL;
+	else
+		return (ImageResource*) PageManager::FindResource(name);
+	// TODO: make resource lookup type-safe
+}
+
+AnimationResource* LoadAttrAnimation(xml_node<>* element, const char* attrname)
+{
+	std::string name = LoadAttrString(element, attrname, "");
+	if (name.empty())
+		return NULL;
+	else
+		return (AnimationResource*) PageManager::FindResource(name);
+	// TODO: make resource lookup type-safe
+}
+
 bool LoadPlacement(xml_node<>* node, int* x, int* y, int* w /* = NULL */, int* h /* = NULL */, RenderObject::Placement* placement /* = NULL */)
 {
 	if (!node)
 		return false;
 
-	std::string value;
 	if (node->first_attribute("x"))
-	{
-		value = node->first_attribute("x")->value();
-		DataManager::GetValue(value, value);
-		*x = atol(value.c_str());
-		*x = scale_theme_x(*x);
-		*x += tw_x_offset;
-	}
+		*x = LoadAttrIntScaleX(node, "x") + tw_x_offset;
 
 	if (node->first_attribute("y"))
-	{
-		value = node->first_attribute("y")->value();
-		DataManager::GetValue(value, value);
-		*y = atol(value.c_str());
-		*y = scale_theme_y(*y);
-		*y += tw_y_offset;
-	}
+		*y = LoadAttrIntScaleY(node, "y") + tw_y_offset;
 
 	if (w && node->first_attribute("w"))
-	{
-		value = node->first_attribute("w")->value();
-		DataManager::GetValue(value, value);
-		*w = atol(value.c_str());
-		*w = scale_theme_x(*w);
-	}
+		*w = LoadAttrIntScaleX(node, "w");
 
 	if (h && node->first_attribute("h"))
-	{
-		value = node->first_attribute("h")->value();
-		DataManager::GetValue(value, value);
-		*h = atol(value.c_str());
-		*h = scale_theme_y(*h);
-	}
+		*h = LoadAttrIntScaleY(node, "h");
 
 	if (placement && node->first_attribute("placement"))
-	{
-		value = node->first_attribute("placement")->value();
-		DataManager::GetValue(value, value);
-		*placement = (RenderObject::Placement) atol(value.c_str());
-	}
+		*placement = (RenderObject::Placement) LoadAttrInt(node, "placement");
 
 	return true;
 }
diff --git a/gui/pages.hpp b/gui/pages.hpp
index b042c0d..31ccadb 100644
--- a/gui/pages.hpp
+++ b/gui/pages.hpp
@@ -17,12 +17,15 @@
 	TOUCH_REPEAT = 4
 };
 
-typedef struct {
+struct COLOR {
 	unsigned char red;
 	unsigned char green;
 	unsigned char blue;
 	unsigned char alpha;
-} COLOR;
+	COLOR() : red(0), green(0), blue(0), alpha(0) {}
+	COLOR(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 255)
+		: red(r), green(g), blue(b), alpha(a) {}
+};
 
 // Utility Functions
 int ConvertStrToColor(std::string str, COLOR* color);
diff --git a/gui/partitionlist.cpp b/gui/partitionlist.cpp
index 97f6e4e..8facfe7 100644
--- a/gui/partitionlist.cpp
+++ b/gui/partitionlist.cpp
@@ -35,7 +35,6 @@
 	xml_attribute<>* attr;
 	xml_node<>* child;
 
-	int mIconWidth = 0, mIconHeight = 0, mSelectedIconHeight = 0, mSelectedIconWidth = 0, mUnselectedIconHeight = 0, mUnselectedIconWidth = 0;
 	mIconSelected = mIconUnselected = NULL;
 	mUpdate = 0;
 	updateList = false;
@@ -43,12 +42,8 @@
 	child = node->first_node("icon");
 	if (child)
 	{
-		attr = child->first_attribute("selected");
-		if (attr)
-			mIconSelected = PageManager::FindResource(attr->value());
-		attr = child->first_attribute("unselected");
-		if (attr)
-			mIconUnselected = PageManager::FindResource(attr->value());
+		mIconSelected = LoadAttrImage(child, "selected");
+		mIconUnselected = LoadAttrImage(child, "unselected");
 	}
 
 	// Handle the result variable
@@ -63,25 +58,9 @@
 			selectedList = attr->value();
 	}
 
-	if (mIconSelected && mIconSelected->GetResource())
-	{
-		mSelectedIconWidth = gr_get_width(mIconSelected->GetResource());
-		mSelectedIconHeight = gr_get_height(mIconSelected->GetResource());
-		if (mSelectedIconHeight > mIconHeight)
-			mIconHeight = mSelectedIconHeight;
-		mIconWidth = mSelectedIconWidth;
-	}
-
-	if (mIconUnselected && mIconUnselected->GetResource())
-	{
-		mUnselectedIconWidth = gr_get_width(mIconUnselected->GetResource());
-		mUnselectedIconHeight = gr_get_height(mIconUnselected->GetResource());
-		if (mUnselectedIconHeight > mIconHeight)
-			mIconHeight = mUnselectedIconHeight;
-		if (mUnselectedIconWidth > mIconWidth)
-			mIconWidth = mUnselectedIconWidth;
-	}
-	SetMaxIconSize(mIconWidth, mIconHeight);
+	int iconWidth = std::max(mIconSelected->GetWidth(), mIconUnselected->GetWidth());
+	int iconHeight = std::max(mIconSelected->GetHeight(), mIconUnselected->GetHeight());
+	SetMaxIconSize(iconWidth, iconHeight);
 
 	child = node->first_node("listtype");
 	if (child && (attr = child->first_attribute("name"))) {
@@ -218,7 +197,7 @@
 	return mList.size();
 }
 
-int GUIPartitionList::GetListItem(size_t item_index, Resource*& icon, std::string &text)
+int GUIPartitionList::GetListItem(size_t item_index, ImageResource*& icon, std::string &text)
 {
 	text = mList.at(item_index).Display_Name;
 	if (mList.at(item_index).selected)
diff --git a/gui/progressbar.cpp b/gui/progressbar.cpp
index a4d1329..a49e0ab 100644
--- a/gui/progressbar.cpp
+++ b/gui/progressbar.cpp
@@ -45,13 +45,8 @@
 	child = node->first_node("resource");
 	if (child)
 	{
-		attr = child->first_attribute("empty");
-		if (attr)
-			mEmptyBar = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("full");
-		if (attr)
-			mFullBar = PageManager::FindResource(attr->value());
+		mEmptyBar = LoadAttrImage(child, "empty");
+		mFullBar = LoadAttrImage(child, "full");
 	}
 
 	// Load the placement
@@ -61,23 +56,13 @@
 	child = node->first_node("data");
 	if (child)
 	{
-		attr = child->first_attribute("min");
-		if (attr)   mMinValVar = attr->value();
-
-		attr = child->first_attribute("max");
-		if (attr)   mMaxValVar = attr->value();
-
-		attr = child->first_attribute("name");
-		if (attr)   mCurValVar = attr->value();
+		mMinValVar = LoadAttrString(child, "min");
+		mMaxValVar = LoadAttrString(child, "max");
+		mCurValVar = LoadAttrString(child, "name");
 	}
 
-	if (mEmptyBar && mEmptyBar->GetResource())
-	{
-		mRenderW = gr_get_width(mEmptyBar->GetResource());
-		mRenderH = gr_get_height(mEmptyBar->GetResource());
-	}
-
-	return;
+	mRenderW = mEmptyBar->GetWidth();
+	mRenderH = mEmptyBar->GetHeight();
 }
 
 int GUIProgressBar::Render(void)
diff --git a/gui/resources.cpp b/gui/resources.cpp
index d9f2741..e0016fc 100644
--- a/gui/resources.cpp
+++ b/gui/resources.cpp
@@ -314,7 +314,8 @@
 		{
 			LOGERR("Resource type (%s) not supported.\n", type.c_str());
 		}
-		if (res == NULL || res->GetResource() == NULL)
+
+		if (res == NULL || !res->loadedOK())
 		{
 			std::string res_name;
 			if (child->first_attribute("name"))
diff --git a/gui/resources.hpp b/gui/resources.hpp
index cc5e7b6..69d2427 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -17,8 +17,8 @@
 	virtual ~Resource() {}
 
 public:
-	virtual void* GetResource(void) = 0;
-	std::string GetName(void) { return mName; }
+	std::string GetName() { return mName; }
+	virtual bool loadedOK() = 0;
 
 private:
 	std::string mName;
@@ -44,7 +44,10 @@
 	virtual ~FontResource();
 
 public:
-	virtual void* GetResource(void) { return mFont; }
+	void* GetResource() { return this ? mFont : NULL; }
+	int GetHeight() { return gr_getMaxFontHeight(this ? mFont : NULL); }
+
+	virtual bool loadedOK() { return mFont != NULL; }
 
 protected:
 	void* mFont;
@@ -58,7 +61,11 @@
 	virtual ~ImageResource();
 
 public:
-	virtual void* GetResource(void) { return mSurface; }
+	gr_surface GetResource() { return this ? mSurface : NULL; }
+	int GetWidth() { return gr_get_width(this ? mSurface : NULL); }
+	int GetHeight() { return gr_get_height(this ? mSurface : NULL); }
+
+	virtual bool loadedOK() { return mSurface != NULL; }
 
 protected:
 	gr_surface mSurface;
@@ -71,9 +78,12 @@
 	virtual ~AnimationResource();
 
 public:
-	virtual void* GetResource(void) { return mSurfaces.empty() ? NULL : mSurfaces.at(0); }
-	virtual void* GetResource(int entry) { return mSurfaces.empty() ? NULL : mSurfaces.at(entry); }
-	virtual int GetResourceCount(void) { return mSurfaces.size(); }
+	gr_surface GetResource() { return (!this || mSurfaces.empty()) ? NULL : mSurfaces.at(0); }
+	gr_surface GetResource(int entry) { return (!this || mSurfaces.empty()) ? NULL : mSurfaces.at(entry); }
+	int GetWidth() { return gr_get_width(this ? GetResource() : NULL); }
+	int GetHeight() { return gr_get_height(this ? GetResource() : NULL); }
+	int GetResourceCount() { return mSurfaces.size(); }
+	virtual bool loadedOK() { return !mSurfaces.empty(); }
 
 protected:
 	std::vector<gr_surface> mSurfaces;
diff --git a/gui/scrolllist.cpp b/gui/scrolllist.cpp
index eb66de8..822fa76 100644
--- a/gui/scrolllist.cpp
+++ b/gui/scrolllist.cpp
@@ -41,7 +41,8 @@
 	firstDisplayedItem = mItemSpacing = mFontHeight = mSeparatorH = y_offset = scrollingSpeed = 0;
 	maxIconWidth = maxIconHeight =  mHeaderIconHeight = mHeaderIconWidth = 0;
 	mHeaderSeparatorH = mHeaderIsStatic = mHeaderH = actualItemHeight = 0;
-	mBackground = mFont = mHeaderIcon = NULL;
+	mBackground = mHeaderIcon = NULL;
+	mFont = NULL;
 	mBackgroundW = mBackgroundH = 0;
 	mFastScrollW = mFastScrollLineW = mFastScrollRectW = mFastScrollRectH = 0;
 	lastY = last2Y = fastScroll = 0;
@@ -63,9 +64,7 @@
 	child = node->first_node("header");
 	if (child)
 	{
-		attr = child->first_attribute("icon");
-		if (attr)
-			mHeaderIcon = PageManager::FindResource(attr->value());
+		mHeaderIcon = LoadAttrImage(child, "icon");
 
 		attr = child->first_attribute("background");
 		if (attr)
@@ -119,9 +118,7 @@
 	child = node->first_node("background");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mBackground = PageManager::FindResource(attr->value());
+		mBackground = LoadAttrImage(child, "resource");
 		attr = child->first_attribute("color");
 		if (attr)
 		{
@@ -140,9 +137,7 @@
 	child = node->first_node("font");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mFont = PageManager::FindResource(attr->value());
+		mFont = LoadAttrFont(child, "resource");
 
 		attr = child->first_attribute("color");
 		if (attr)
@@ -229,13 +224,13 @@
 	}
 
 	// Retrieve the line height
-	mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
+	mFontHeight = mFont->GetHeight();
 	mHeaderH = mFontHeight;
 
 	if (mHeaderIcon && mHeaderIcon->GetResource())
 	{
-		mHeaderIconWidth = gr_get_width(mHeaderIcon->GetResource());
-		mHeaderIconHeight = gr_get_height(mHeaderIcon->GetResource());
+		mHeaderIconWidth = mHeaderIcon->GetWidth();
+		mHeaderIconHeight = mHeaderIcon->GetHeight();
 		if (mHeaderIconHeight > mHeaderH)
 			mHeaderH = mHeaderIconHeight;
 		if (mHeaderIconWidth > maxIconWidth)
@@ -252,8 +247,8 @@
 
 	if (mBackground && mBackground->GetResource())
 	{
-		mBackgroundW = gr_get_width(mBackground->GetResource());
-		mBackgroundH = gr_get_height(mBackground->GetResource());
+		mBackgroundW = mBackground->GetWidth();
+		mBackgroundH = mBackground->GetHeight();
 	}
 }
 
@@ -349,7 +344,7 @@
 			break;
 
 		// get item data
-		Resource* icon;
+		ImageResource* icon;
 		std::string label;
 		if (GetListItem(itemindex, icon, label))
 			break;
@@ -373,8 +368,8 @@
 		}
 
 		if (icon && icon->GetResource()) {
-			int currentIconHeight = gr_get_height(icon->GetResource());
-			int currentIconWidth = gr_get_width(icon->GetResource());
+			int currentIconHeight = icon->GetHeight();
+			int currentIconWidth = icon->GetWidth();
 			int currentIconOffsetY = (int)((actualItemHeight - currentIconHeight) / 2);
 			int currentIconOffsetX = (maxIconWidth - currentIconWidth) / 2;
 			int rect_y = 0, image_y = (yPos + currentIconOffsetY);
@@ -405,11 +400,10 @@
 	// Now, we need the header (icon + text)
 	yPos = mRenderY;
 	{
-		Resource* headerIcon;
 		int mIconOffsetX = 0;
 
 		// render the icon if it exists
-		headerIcon = mHeaderIcon;
+		ImageResource* headerIcon = mHeaderIcon;
 		if (headerIcon && headerIcon->GetResource())
 		{
 			gr_blit(headerIcon->GetResource(), 0, 0, mHeaderIconWidth, mHeaderIconHeight, mRenderX + ((mHeaderIconWidth - maxIconWidth) / 2), (yPos + (int)((mHeaderH - mHeaderIconHeight) / 2)));
diff --git a/gui/slider.cpp b/gui/slider.cpp
index 98d2dde..c53dabc 100644
--- a/gui/slider.cpp
+++ b/gui/slider.cpp
@@ -47,31 +47,20 @@
 	child = node->first_node("resource");
 	if (child)
 	{
-		attr = child->first_attribute("base");
-		if (attr)
-			sSlider = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("used");
-		if (attr)
-			sSliderUsed = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("touch");
-		if (attr)
-			sTouch = PageManager::FindResource(attr->value());
+		sSlider = LoadAttrImage(child, "base");
+		sSliderUsed = LoadAttrImage(child, "used");
+		sTouch = LoadAttrImage(child, "touch");
 	}
 
 	// Load the placement
 	LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY);
 
-	if (sSlider && sSlider->GetResource())
-	{
-		mRenderW = gr_get_width(sSlider->GetResource());
-		mRenderH = gr_get_height(sSlider->GetResource());
-	}
+	mRenderW = sSlider->GetWidth();
+	mRenderH = sSlider->GetHeight();
 	if (sTouch && sTouch->GetResource())
 	{
-		sTouchW = gr_get_width(sTouch->GetResource());  // Width of the "touch image" that follows the touch (arrow)
-		sTouchH = gr_get_height(sTouch->GetResource()); // Height of the "touch image" that follows the touch (arrow)
+		sTouchW = sTouch->GetWidth();  // Width of the "touch image" that follows the touch (arrow)
+		sTouchH = sTouch->GetHeight(); // Height of the "touch image" that follows the touch (arrow)
 	}
 
 	//LOGINFO("mRenderW: %i mTouchW: %i\n", mRenderW, mTouchW);
diff --git a/gui/slidervalue.cpp b/gui/slidervalue.cpp
index 7c38e32..5be58dc 100644
--- a/gui/slidervalue.cpp
+++ b/gui/slidervalue.cpp
@@ -73,16 +73,8 @@
 	child = node->first_node("font");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mFont = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("color");
-		if (attr)
-		{
-			std::string color = attr->value();
-			ConvertStrToColor(color, &mTextColor);
-		}
+		mFont = LoadAttrFont(child, "resource");
+		mTextColor = LoadAttrColor(child, "color", mTextColor);
 	}
 
 	// Load the placement
@@ -103,17 +95,9 @@
 	child = node->first_node("resource");
 	if (child)
 	{
-		attr = child->first_attribute("background");
-		if(attr)
-			mBackgroundImage = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("handle");
-		if(attr)
-			mHandleImage = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("handlehover");
-		if(attr)
-			mHandleHoverImage = PageManager::FindResource(attr->value());
+		mBackgroundImage = LoadAttrImage(child, "background");
+		mHandleImage = LoadAttrImage(child, "handle");
+		mHandleHoverImage = LoadAttrImage(child, "handlehover");
 	}
 
 	child = node->first_node("data");
@@ -199,7 +183,7 @@
 		}
 	}
 
-	mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
+	mFontHeight = mFont->GetHeight();
 
 	if(mShowCurr)
 	{
@@ -277,8 +261,8 @@
 
 	if(mBackgroundImage && mBackgroundImage->GetResource())
 	{
-		mLineW = gr_get_width(mBackgroundImage->GetResource());
-		mLineH = gr_get_height(mBackgroundImage->GetResource());
+		mLineW = mBackgroundImage->GetWidth();
+		mLineH = mBackgroundImage->GetHeight();
 	}
 	else
 		mLineW = mRenderW - (mLinePadding * 2);
diff --git a/gui/text.cpp b/gui/text.cpp
index 29d7ad9..cc18b17 100644
--- a/gui/text.cpp
+++ b/gui/text.cpp
@@ -28,9 +28,6 @@
 GUIText::GUIText(xml_node<>* node)
 	: GUIObject(node)
 {
-	xml_attribute<>* attr;
-	xml_node<>* child;
-
 	mFont = NULL;
 	mIsStatic = 1;
 	mVarChanged = 0;
@@ -38,53 +35,21 @@
 	maxWidth = 0;
 	charSkip = 0;
 	isHighlighted = false;
-	hasHighlightColor = false;
 
 	if (!node)
 		return;
 
-	// Initialize color to solid black
-	memset(&mColor, 0, sizeof(COLOR));
-	mColor.alpha = 255;
-	memset(&mHighlightColor, 0, sizeof(COLOR));
-	mHighlightColor.alpha = 255;
-
-	attr = node->first_attribute("color");
-	if (attr)
-	{
-		std::string color = attr->value();
-		ConvertStrToColor(color, &mColor);
-	}
-	attr = node->first_attribute("highlightcolor");
-	if (attr)
-	{
-		std::string color = attr->value();
-		ConvertStrToColor(color, &mHighlightColor);
-		hasHighlightColor = true;
-	}
+	// Load colors
+	mColor = LoadAttrColor(node, "color", COLOR(0,0,0,255));
+	mHighlightColor = LoadAttrColor(node, "highlightcolor", mColor);
 
 	// Load the font, and possibly override the color
-	child = node->first_node("font");
+	xml_node<>* child = node->first_node("font");
 	if (child)
 	{
-		attr = child->first_attribute("resource");
-		if (attr)
-			mFont = PageManager::FindResource(attr->value());
-
-		attr = child->first_attribute("color");
-		if (attr)
-		{
-			std::string color = attr->value();
-			ConvertStrToColor(color, &mColor);
-		}
-
-		attr = child->first_attribute("highlightcolor");
-		if (attr)
-		{
-			std::string color = attr->value();
-			ConvertStrToColor(color, &mHighlightColor);
-			hasHighlightColor = true;
-		}
+		mFont = LoadAttrFont(child, "resource");
+		mColor = LoadAttrColor(child, "color", mColor);
+		mHighlightColor = LoadAttrColor(child, "highlightcolor", mColor);
 	}
 
 	// Load the placement
@@ -97,8 +62,7 @@
 	mLastValue = parseText();
 	if (mLastValue != mText)   mIsStatic = 0;
 
-	mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
-	return;
+	mFontHeight = mFont->GetHeight();
 }
 
 int GUIText::Render(void)
@@ -107,13 +71,11 @@
 		return 0;
 
 	void* fontResource = NULL;
-	string displayValue;
-
 	if (mFont)
 		fontResource = mFont->GetResource();
 
 	mLastValue = parseText();
-	displayValue = mLastValue;
+	string displayValue = mLastValue;
 
 	if (charSkip)
 		displayValue.erase(0, charSkip);
@@ -138,7 +100,7 @@
 			y -= mFontHeight;
 	}
 
-	if (hasHighlightColor && isHighlighted)
+	if (isHighlighted)
 		gr_color(mHighlightColor.red, mHighlightColor.green, mHighlightColor.blue, mHighlightColor.alpha);
 	else
 		gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
