#0 Some code refactoring