Rewritten to remove redundant methods.