refactor code to remove duplicate .xml layout files