applied the code design suggestions #274