refactor or patterns