reference() method added to make it extensible

and fix it up to make it more readable.

one can extend reference() method like as following
1. support predefined labels
2. auto numbered references (more work needed)