Separated javascript methods into own file