refactor & bugfix...