private void getDatabaseData(){
		try
		{
			ArrayList<Activity> actList = factory.getActivities();
			for(Activity activity : actList){
				activities.put(activity.getKey(), activity);
			}
			
			plans = factory.getWorkoutPlansForUser(gym.loggedIn);
			for(WorkoutPlan plan : plans){
				ArrayList<PlanElement> planElements = factory.getPlanElements(plan);
				if(planElements == null)
					continue;
				
				for(PlanElement element : planElements)
					elements.put(element.getKey(), element);
				
				for(PlanElement element : elements.values()){
					elementRequirements.put(element.getKey(), element.getNRequired());
				}
			}
			
			logs = factory.getWorkoutLogs(gym.loggedIn);
			for(WorkoutLog log : logs){
				int elementKey = log.getElementKey();
				Integer nLogged = completion.get(elementKey);
				completion.put(elementKey, 
						nLogged == null ? log.getNCompleted() : nLogged + log.getNCompleted());
			}
		} catch (SQLException e) {
			// TODO handle this
			e.printStackTrace();
		}
	}