more refactoring and moving stuff outof graphite panel