private void loadClass(Class<?> aClass, Object jObject, boolean onlyStatics) {
        List<Method> methods = ClassUtil.getAllDeclaredMethods(aClass);

        /*
         * first join all the functions with the same name (group the overloaded
         * functions)
         */
        Map<String, List<Method>> grouped = new HashMap<String, List<Method>>();
        for (Method m : methods) {
            boolean isStatic = (m.getModifiers() & Modifier.STATIC) != 0;
            if (isStatic || !onlyStatics) {
                if (!grouped.containsKey(m.getName())) {
                    grouped.put(m.getName(), new ArrayList<Method>());
                }

                grouped.get(m.getName()).add(m);

            }
        }

        /*
         * Now iterate over the grouped functions to add them to the scoped
         * object
         */
        for (List<Method> overloads : grouped.values()) {
            if (!overloads.isEmpty()) {
                Method m = overloads.get(0);
                LeoNativeFunction func = new LeoNativeFunction(overloads, jObject);

                if (m.isAnnotationPresent(LeolaMethod.class)) {
                    storeObject(m.getAnnotation(LeolaMethod.class).alias(), func);
                }
                else {
                    storeObject(m.getName(), func);
                }
            }
        }
    }