Start improving JS architecture