javascript practice, namespace and composition