Restructuring continues...
Changes are in main activity.
Small changes in Ref.java