bugfixed
Refactaring