Navigation works fine on XML's IDs. Code refactored, added comments and javadoc