How to achieve decoupling in JavaScript | Hacker News Reader