Refactoring of ShivaLib