Little refactoring here and there