fixed bugs
refactored Util