Working on advanced R features for code improvement