Moved code around. because MonoDevelop is weird