Added session and type serializer, refactored the whole project