Refactory to better design of test. TODO