FIX: code refactoring