cleaner code + some updates