Some refactring