Some refactoring - did not work - just commiting for mobile development