Bug Fix & Refactor