Cleaned up code: added javadoc comments, removed hard-coded strings.