Code refactoring of smartnurse