Changed to classes aproach. Cleaner code (not much)