Fixed transient and more refactoring