This will give robust and test code for Apex