Refactored cylinder, removed doubled code.