better js structure