Refactos js classes