refactored soem stuff