Cleaned up js structuring