Failed attempt at making it more JS like