LPS-32801 - Refactor ATag.java code

http://issues.liferay.com/browse/LPS-32801