better structure of js