Move library logic to folder.
Fix outdated comment.
Add debug logging.
Hide debugging unless needed.